const MonacoEditorWebpackPlugin = require('monaco-editor-webpack-plugin')

module.exports = {
    publicPath: './',
    outputDir: 'dist',
    devServer: {
        disableHostCheck: true,
        port: 8009,
        open: true,
        overlay: {
            warnings: false,
            errors: true,
        },
        proxy: {
            '/fast/': {
                target: 'http://127.0.0.1:9999/fast',
                ws: false,
                changeOrigin: true,
                pathRewrite: {
                    '/fast': '',
                },
            },
            '/file': {
                target: 'http://127.0.0.1:9999/fast/',
                ws: false,
                changeOrigin: true,
            },
        },
    },
    chainWebpack: (config) => {
        config.plugin('monaco').use(new MonacoEditorWebpackPlugin())
    }
};
